#include<stdio.h>
#include<stdlib.h>
#include<math.h>

double polynom(double x, double a[], int n)
{
	int i;
	double st=1, summ=0;
	for (i = 0; i<n; i++){
	summ= summ *x + a[i];  
	}

	return summ;

}

void main()

{
	double x,r, summ, ch[1000];
	int i, n=0;

	printf("vvedite cotfficientu pri ctepenyah nachinaya s nulevoy stepeni\n ");

	for (i = 0; i < 100000; i++){
			r = scanf(" %lf", &ch[i]);
			if (r==0) break;
			n++;
		}
	
	printf("vvedite x \n");
	scanf("%lf", &x);

	 summ = polynom(x,ch,n);

	
		printf("znachenie mnogochlena = %f \n", summ);

	system("pause");
}